import Vue from 'vue'
import VueRouter from "vue-router";
import ArticleDetail from "@/views/ArticleDetail"
import Layout from "@/views/Layout"
import Article from "@/views/Article"
import Collect from "@/views/Collect"
import Like from "@/views/Like"
import User from "@/views/User"

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [{
    path: '/detail/:id',
    component:ArticleDetail
  },{
    path: '/',
    component: Layout,
    children: 
      [
        { path: '/article',
        component:Article
    },
        { path: '/collect',
        component:Collect
    },
        { path: '/like',
        component:Like
    },
        { path: '/user',
        component:User
    }]
  },
  ]
})

export default router